package org.xxpay.pay.channel.jeepay;

import com.alibaba.fastjson.JSONObject;
import org.springframework.stereotype.Component;
import org.springframework.util.Assert;

/**
 * @description: jeepay
 */
@Component
public class JeepayConfig {

    public static final String CHANNEL_NAME = "jeepay"; //渠道名称

    private String mchNo; // 商户号

    private String appId; // 应用ID

    private String appKey;  // 应用私钥

    private String reqUrl;  // 支付网关地址

    public JeepayConfig(){}

    public JeepayConfig(String payParam) {
        Assert.notNull(payParam, "init " + CHANNEL_NAME + " config error");
        JSONObject object = JSONObject.parseObject(payParam);
        this.mchNo = object.getString("mchNo");
        this.appKey = object.getString("appKey");
        this.reqUrl = object.getString("reqUrl");
        this.appId = object.getString("appId");
    }

    public String getMchNo() {
        return mchNo;
    }

    public void setMchNo(String mchNo) {
        this.mchNo = mchNo;
    }

    public String getAppKey() {
        return appKey;
    }

    public void setAppKey(String appKey) {
        this.appKey = appKey;
    }

    public String getReqUrl() {
        return reqUrl;
    }

    public void setReqUrl(String reqUrl) {
        this.reqUrl = reqUrl;
    }

    public String getAppId() {
        return appId;
    }

    public void setAppId(String appId) {
        this.appId = appId;
    }
}
